package com.whynot.frame.auth.shiro.argument;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import java.util.List;

/**
 * 描述: 直接通过注解获取用户信息:
 * 作者: chenyao
 * 日期: 2018-01-30.
 * 项目名称: curtain-whynot-shiro-jwt-server
 * 版本: 1.0.0
 * JDK: since 1.8
 */
@Configuration
public class WebUserConfig extends WebMvcConfigurerAdapter {

    @Override
    public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
        argumentResolvers.add(new CurrentUserMethodArgumentResolver());
        super.addArgumentResolvers(argumentResolvers);
    }
}
